package com.sesame.user.controller;

import com.sesame.user.bean.User;
import com.sesame.user.service.UserService;
import kim.sesame.common.web.controller.AbstractWebController;
import kim.sesame.common.result.ApiResult;
import lombok.extern.apachecommons.CommonsLog;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * UserController
 *
 * @author admin
 * @date 2019-01-30 13:03:18
 * @Description:
 */
@CommonsLog
@RestController
@RequestMapping("/user")
public class UserController extends AbstractWebController {

    @Resource
    private UserService userService;


    /**
     * 保存
     *
     * @author admin
     * @date 2019-01-30 13:03:18
     * @Description:
     */
    @RequestMapping("/save")
    public ApiResult save(User bean) {
        bean.initUpdate(bean.getUpdateUser());
        int res = userService.update(bean);
        return success(res);
    }


}
